/*
 * Copyright (c) 2024 Black Sesame Technologies
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _DAL_SERVICE_H_
#define _DAL_SERVICE_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "dal/ret_type.h"
#include "dal/dds_entity.h"
#include "dal/qos_policy.h"
#include "dal/service_info.h"

typedef void (*dal_service_on_request_t)(const void* user_data);

dal_ret_t dal_service_take_request(dal_service_t* service,
                                   dal_service_info_t* request_header,
                                   void* request,
                                   bool* taken);
dal_ret_t
dal_service_send_response(dal_service_t* service, dal_request_id_t* request_header, void* response);
void dal_service_set_on_request_callback(dal_service_t* service,
                                         dal_service_on_request_t on_request,
                                         const void* user_data);

#ifdef __cplusplus
}
#endif

#endif  // _DAL_SERVICE_H_
